package classification;

import basics.Dataset;
import basics.Vector;
import basics.VectorMatrix;

public abstract class Classifier<C> {

	public abstract void train(Dataset<Vector, C> ds);

	public abstract C predict(VectorMatrix v);

	public int measureAccuracy(Dataset<Vector, C> test) {
		int currect = 0;

		for (int i = 0; i < test.size(); i++) {
			if (predict(test.feature(i)).equals(test.classVal(i))) {
				currect++;
			}
		}

		return currect;
	}
}
